#include "demo_stub.h"
#include "ipc_skeleton.h"
#include "message_parcel.h"

namespace OHOS {
using namespace std;

DemoStub::DemoStub() {}
DemoStub::~DemoStub() {}

int32_t DemoStub::OnRemoteRequest(uint32_t code,
    MessageParcel& data, MessageParcel& reply, MessageOption& option) {
  if (code == 1) {
    return StartRemoteAbilityInner(data, reply);
  }
  return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
}

int32_t DemoStub::StartRemoteAbilityInner(MessageParcel& data,
	       	MessageParcel& reply) {
  uint32_t accessToken = 0;
  data.ReadUint32(accessToken);
  int32_t result = StartRemoteAbility(accessToken);
  return result;
}
}
